#include "encode.h"
#include "iostream"
int test1()
{
    char a = 3;
    std::cout << "a:" << (int)a << "\n";
    std::cout << "a:";
    printBinary(a);
    char res = parityCheck(a);
    printBinary(res);
    std::cout << (int)res;
    return 0;
}
void test2()
{
    //编码
    //0000 0011
    char *a = encode("ABC");
    for (int i = 0; i < strlen(a); i++)
    {
        printBinary(a[i]);
    }
    std::cout << "len=" << strlen(a) << "\n";
    writeEncode(a);
}
void test3()
{
    std::cout << "hello\n";
    char *a = readAndDecode();
    std::cout << "len=" << strlen(a) << "\n";
    for (int i = 0; i < strlen(a); i++)
    {
        printBinary(a[i]);
    }
}
void test4()
{
    //测试二进制读写
    writeEncode("hi");
    char *data = readEncode(2);
    std::cout << data << "\n";
}
int main(int argc, char const *argv[])
{
    test2();
}
